package com.game.spacetrader;

import java.io.Serializable;

import com.game.spacetrader.map.Coordinates;

/**
 * Class represents a Planet in the game
 *
 */
public class Planet implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String solarSystem, name;
	private int x, y;
	private Coordinates coord;
	private int techLevel, resources;
	private RandomEvent event;
	
	/**
	 * Constructor
	 * @param solarSystem solar system the planet is in
	 * @param x x coordinate
	 * @param y y coordinate
	 * @param techLevel tech level of the planet
	 * @param resources resources of the planet
	 */
	public Planet(String name, String solarSystem, int x, int y, int techLevel, int resources){
		this.name=name;
		this.solarSystem=solarSystem;
		coord = new Coordinates(x,y);
		this.x=x;
		this.y=y;
		this.techLevel=techLevel;
		this.resources=resources;
	}

	public Planet(){
		this("","",0,0,0,0);
	}
	public String getSolarSystem() {
		return solarSystem;
	}

	public void setSolarSystem(String solarSystem) {
		this.solarSystem = solarSystem;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getTechLevel() {
		return techLevel;
	}

	public void setTechLevel(int techLevel) {
		this.techLevel = techLevel;
	}

	public int getResources() {
		return resources;
	}

	public void setResources(int resources) {
		this.resources = resources;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Coordinates getCoord() {
		return coord;
	}

	public void setCoord(Coordinates coord) {
		this.coord = coord;
	}
	
	public RandomEvent getEvent(){
		return event;
	}
	
	public void newEvent(){
		event = new RandomEvent();
	}
}
